package LeiHeiDuiXiang.LeiHeDuiXiang1;

class WashMachine{
    //字段、属性、成员变量
    public String brand;//品牌
    public String type;//型号
    public double weight;//重量
    public double length;//长
    public double width;//宽
    public double height;//高
    public String color;//颜色
    //行为、成员方法
    public void washClothes(){//洗衣服
        System.out.println("洗衣功能");
    }
    public void dryClothes(){//脱水
        System.out.println("脱水功能");
    }
    public void setTime(){//定时
        System.out.println("定时功能");
    }
}



public class Test2 {
    public void test(){
        System.out.println("test....");
    }
}


class Dog{
    public String name;
    public int age;

    public void eat(){//和类不同名是成员方法，和类同名是构造器
        System.out.println(name+"吃狗粮");
    }

    public static void main(String[] args) {
        Test2 test2=new Test2();
        test2.test();

        Dog dog1=new Dog();
        dog1.name="小黑";
        dog1.age=1;
        dog1.eat();
        System.out.println(dog1.name);
        System.out.println(dog1.age);
        System.out.println("=========");

        Dog dog2=new Dog();
        dog2.name="小黄";
        dog2.age=10;
        dog2.eat();
        System.out.println(dog2.name);
        System.out.println(dog2.age);
    }
    //test();
}